<template>
    <div>
        <h1>图书详情</h1>
        <p v-for="(i,j) in nr" :key="j">
            图书名字: {{i.name}}--图书标题: {{i.title}}---图书内容: {{i.content}}
        </p>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            baseurl:'http://127.0.0.1:8000',
            nr:[],
            id:this.$route.query.id
            
        }
    },
    methods:{
        jiazai(){
            axios({
                url:this.baseurl + '/app01/books/?id='+this.id,
            }).then(res =>{
                console.log(res.data)
                this.nr = res.data.ca
            })
        }
    },
    created(){
        this.jiazai()
    }
}
</script>

<style>

</style>